#ifndef PAQUETEHASHEMISOR_H_INCLUDED
#define PAQUETEHASHEMISOR_H_INCLUDED

#include <string>
#include "PaqueteHashReceptor.h"
#include "LectorDeSegmento.h"
#include "MD5.h"
class PaqueteHashEmisor{
    private:
    unsigned int numP;
    std::string ROLLINGCS;
    public:
    PaqueteHashEmisor(unsigned int np , std::string& h ):numP(np),ROLLINGCS(h){}

    std::string getHashDebil(){return this->ROLLINGCS;}

    unsigned int getNp(){return this->numP;}

    bool VerificacionDebil(const PaqueteHashReceptor& PhR)
    {
        return (this->ROLLINGCS == PhR.ROLLINGCS);
    }

    bool VerificacionFuerte(const PaqueteHashReceptor& PhR
                            ,LectorDeSegmento& LectorSegm)
    {
        std::string BloqueEmisor = LectorSegm.getDif( this->numP ,TAM_PEDAZO );
        MD5 md5( BloqueEmisor );
        std::string StrongChecksum = md5.hexdigest() ;
        return ( StrongChecksum == PhR.MD5);
    }
};

#endif // PAQUETEHASHEMISOR_H_INCLUDED
